﻿using BCCommon.Enums;
using BCCommon.PaymentEnums;
using BCEntity.Common.FlowRecord;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace BCData.Common.FlowRecord
{
    /// <summary>
    /// 流水记录
    /// </summary>
    public interface IUserFlowRecordData
    {
        /// <summary>
        /// 添加流水记录
        /// </summary>
        /// <param name="entity">流水记录信息</param>
        /// <returns></returns>
        Task<UserFlowRecordEntity> AddAsync(UserFlowRecordEntity entity);

        /// <summary>
        /// 获取流水记录分页信息
        /// </summary>
        /// <param name="userId">用户Id</param>
        /// <param name="orderNo">订单编号</param>
        /// <param name="flowType">流水类型</param>
        /// <param name="flowDirection">资金流向</param>
        /// <param name="payChannel">支付渠道</param>
        /// <param name="startDate">开始时间</param>
        /// <param name="endDate">结束时间</param>
        /// <param name="pageIndex">当前页码</param>
        /// <param name="pageSize">每页数据条数</param>
        /// <returns></returns>
        Task<(IEnumerable<UserFlowRecordEntity>, int)> GetPageableList(long? userId, string orderNo, FlowType? flowType,
            SourceFlowDirectionType? flowDirection, PaymentChannelType? payChannel, DateTime? start, DateTime? end, bool? ascending, int pageIndex, int pageSize);

        /// <summary>
        /// 获取流水户口页信息--单条
        /// </summary>
        /// <param name="flowRecordId">流水记录Id</param>
        /// <returns></returns>
        Task<UserFlowRecordEntity> Get(long flowRecordId);

        /// <summary>
        /// 查看指定用户的账单明细
        /// </summary>
        /// <param name="userId">用户编号</param>
        /// <param name="ascending">升序排序</param>
        /// <param name="pageIndex">分页页码</param>
        /// <param name="pageSize">分页页数</param>
        /// <returns></returns>
        Task<(IEnumerable<UserFlowRecordEntity>, int)> GetFlowDetails(long? userId, bool? ascending, int pageIndex, int pageSize);
        /// <summary>
        /// 获取用户流水记录
        /// </summary>
        /// <param name="orderNo">订单编号</param>
        /// <param name="flowDirectionType">流水方向类型</param>
        /// <param name="flowType">流水类型</param>
        /// <returns></returns>
        Task<UserFlowRecordEntity> Get(string orderNo, SourceFlowDirectionType flowDirectionType, FlowType flowType);

        /// <summary>
        /// 查看指定用户的账单明细
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <param name="start">开始时间</param>
        /// <param name="end">结束时间</param>
        /// <param name="ascending">升序排序</param>
        /// <param name="index">页号</param>
        /// <param name="size">每页数据条数</param>
        /// <returns></returns>
        Task<(IEnumerable<UserFlowRecordEntity>, int)> GetFlowDetails(long userId, DateTime? start, DateTime? end, bool? ascending, int index, int size);

        ///// <summary>
        ///// 查询司机余额支付总金额
        ///// </summary>
        ///// <param name="driverName">司机名称</param>
        ///// <param name="phone">司机手机号</param>
        ///// <param name="vehicleNo">车牌号</param>
        ///// <param name="startDate">开始日期</param>
        ///// <param name="endDate">结束日期</param>
        ///// <returns></returns>
        //Task<decimal> GetDriverPaymentAccountBalance(string driverName, string phone, string vehicleNo, DateTime? startDate, DateTime? endDate);

        ///// <summary>
        ///// 获取司机余额支付明细列表
        ///// </summary>
        ///// <param name="driverName">司机名称</param>
        ///// <param name="phone">司机手机号</param>
        ///// <param name="vehicleNo">车牌号</param>
        ///// <param name="start">开始时间</param>
        ///// <param name="end">结束时间</param>
        ///// <param name="pageIndex">页号</param>
        ///// <param name="pageSize">每页数据条数</param>
        ///// <returns></returns>
        //Task<(IEnumerable<FreightFinanceAccountReferenceBalanceTransformationEntity>, int)> GetList(string driverName, string phone, string vehicleNo, DateTime? start, DateTime? end, int? pageIndex, int? pageSize);
    }
}